#include "widget.h"
#include "ui_widget.h"
#include<QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    QDateTime New = ui->dateTimeEdit_New->dateTime();
    QDateTime old = ui->dateTimeEdit_old->dateTime();
    int day =((New.secsTo(old))/3600)/24;
    int hours = ((New.secsTo(old))/3600)%24;
    qDebug()<<"持续了"<<QString::number(day)<<"天"<<QString::number(hours)<<"小时";


}
